<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Config extends Model {

	public $timestamps = false;

	protected $fillable = [
		'config', 'title', 'say', 'keywords', 'description', 'cache_time', 'nopwd', 'password', 'weibo', 'email', 'wechat', 'github',
	];

	public function setConfigAttribute($value) {
		foreach ($value as $k => $v) {
			$value[$k] = intval($v);
		}
		$this->attributes['config'] = json_encode($value);
	}
}
